package com.blog.back.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.blog.entity.RAitacleClassificationEntity;
import com.blog.back.service.RAitacleClassificationService;
import com.blog.utils.PageUtils;
import com.blog.utils.R;



/**
 * 
 *
 * @author codedorado
 * @email codedorado@foxmail.com
 * @date 2020-08-15 15:26:05
 */
@RestController
@RequestMapping("back/raitacleclassification")
public class RAitacleClassificationController {
    @Autowired
    private RAitacleClassificationService rAitacleClassificationService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    // @RequiresPermissions("back:raitacleclassification:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = rAitacleClassificationService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{aitacleClassificationId}")
    // @RequiresPermissions("back:raitacleclassification:info")
    public R info(@PathVariable("aitacleClassificationId") Long aitacleClassificationId){
		RAitacleClassificationEntity rAitacleClassification = rAitacleClassificationService.getById(aitacleClassificationId);

        return R.ok().put("rAitacleClassification", rAitacleClassification);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    // @RequiresPermissions("back:raitacleclassification:save")
    public R save(@RequestBody RAitacleClassificationEntity rAitacleClassification){
		rAitacleClassificationService.save(rAitacleClassification);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    // @RequiresPermissions("back:raitacleclassification:update")
    public R update(@RequestBody RAitacleClassificationEntity rAitacleClassification){
		rAitacleClassificationService.updateById(rAitacleClassification);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    // @RequiresPermissions("back:raitacleclassification:delete")
    public R delete(@RequestBody Long[] aitacleClassificationIds){
		rAitacleClassificationService.removeByIds(Arrays.asList(aitacleClassificationIds));

        return R.ok();
    }

}
